<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCarsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cars', function (Blueprint $table) {
            $table->id();
            $table->string('name')->nullable()->comment('车名称');
            $table->string('category')->nullable()->comment('车系');
            $table->string('data')->nullable()->comment('车参数：如变速箱');
            $table->string('label')->nullable()->comment('车标签');
            $table->decimal('minimum_price',10,2)->default(0.00)->comment('最低日租金');
            $table->decimal('base_price',10,2)->default(0.00)->comment('基础服务费');
            $table->decimal('brokerage',10,2)->default(0.00)->comment('手续费');
            $table->string('deposit')->nullable()->comment('押金');
            $table->string('break_rules')->nullable()->comment('违章押金');
            $table->text('pic')->nullable()->comment('车图片');
            $table->integer('lease_times')->default(0)->comment('租车次数');
            $table->string('descript')->nullable()->comment('简介');
            $table->integer('stock')->default(1)->comment('库存数量');
            $table->tinyInteger('status')->default(1)->comment('车辆状态 -1：下架，0：已经售罄 1：上架 ');
            $table->longText('drink')->nullable()->comment('随车饮料');
            $table->timestamps();
            $table->longText('non_lease_date')->nullable()->comment('不可租日期');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cars');
    }
}
